home *** CD-ROM | disk | FTP | other *** search
/ EuroCD 3 / EuroCD 3.iso / Programming / Amos / AMOSList-1097 / AMOSLIST / text0051.txt < prev    next >
Encoding:
Text File  |  1998-06-24  |  600 b   |  36 lines

  1.  
  2. > Hi!
  3. > Is there a smooth way to sort 20 variables???
  4. This is the second sorting thing written so heres my bubble sort 
  5. routine.
  6. Im doing this now from memory so it may/may not work
  7.  
  8. Dim v(20)               <-our variables
  9. ...
  10. .....
  11.  
  12. Repeat
  13. c=0
  14. For q=1 to 19
  15. IF v(q)>v(q+1)
  16.  temp=v(q)
  17.  v(q)=v(q+1)
  18.  v(q+1)=temp         <-swap em round
  19.  c=1
  20. END IF
  21. Next q
  22. Until c=0
  23.  
  24. That should work!! hopefuly
  25. ____________________________________
  26. Lee Atkins.
  27. L.A.ATKINS@UCLAN.AC.UK
  28.  
  29. IRC nick : EMBWBAM
  30. ________________________________________
  31. Metal detector mornings!
  32. ________________________________________
  33.  
  34.